Task #M008C
  
The number of numbers
You are given three integers L, R and S, you have to write a program that calculates the count of numbers between L and R to which the sum of digits is equals with S.
Input:
Three integers L, R, and \(S (0 < L ≤ R ≤ 10^{15}, 0 < S ≤ 500)\) are given in a single line
Output:
Print the number of digits in a given row whose sum is S
Examples
| # | input.txt | output.txt |
|---|---|---|
| 1 |
100 500 7 |
22 |